<?php
class Default_Form_Register extends Zend_Form{

	public function init(){
		
		//Thiết lập ngon ngữ
		$translate = Zend_Registry::get('Zend_Translate');
		
		$this->setAttrib('id', 'frm-register');
		$this->setAttrib('class', 'frm-default clearfix');
		
		//email
		$email = $this->createElement('text', 'user_email');
		$email->setLabel($translate->translate('Email'));
		$email->setRequired(true);
		$email->addValidator('emailAddress',false);
		
		//Mật khẩu
		$password = $this->createElement('password', 'user_password');
		$password->setLabel($translate->translate('Mật khẩu'));
		$password->setRequired(true);
		
		$re_password = $this->createElement('password', 'user_password_retype');
		$re_password->setLabel($translate->translate('Nhập lại mật khẩu'));
		$re_password->setRequired(true);
		
		//ho ten 
		$user_fullname = $this->createElement('text', 'user_fullname');
		$user_fullname->setLabel($translate->translate('Họ tên'));
		//địa chỉ
		$address = $this->createElement('text', 'user_address')->setLabel($translate->translate('Địa chỉ'));
		
		//phone
		$user_phone = $this->createElement('text', 'user_phone');
		$user_phone->setLabel($translate->translate('Điện thoại'));
		
		// captch
		$captcha_text = $this->createElement('text', 'captcha_text');
		$captcha_text->setLabel('Nhập captcha');
		
		$captcha_id = $this->createElement('hidden', 'captcha_id');
		//submit		
		$submit = $this->createElement('submit', 'submit')->setAttrib('class', 'button');
		$submit->setLabel($translate->translate('Đăng ký'));
		$this->addElements(array(
				$email,
				$password,
				$re_password,
				$user_fullname,
				$address,
				$user_phone,
// 				$captcha_text,
// 				$captcha_id,
				$submit
		));
	}
}